import React, { useState } from "react";
import HeaderTab from "@/components/CommonTab/index";
import LabelTemplate from "./labelTemplate/index";
import CodeManage from "./codeManage/index";

const tabArr = [
	//顶部tab信息
	{ key: "1", tab: "标签模板" },
	{ key: "2", tab: "字段管理" }
];

const LabelSetting = () => {
	const [type, setType] = useState("1"); //tab
	//顶部tab
	const HeaderTabProps = {
		type,
		data: tabArr,
		onChange(val) {
			setType(val);
		}
	};

	return (
		<>
			<HeaderTab {...HeaderTabProps} />
			{type == "1" ? <LabelTemplate /> : <CodeManage />}
		</>
	);
};

export default LabelSetting;
